<template>
  <el-container style="height: 100vh;">
    <el-aside :width="sideWidth + 'px'" style="background-color: rgb(238, 241, 246); height: 100%">
      <Aside :isCollapse="isCollapse" :logoTextShow="logoTextShow" />
    </el-aside>

    <el-container>

      <el-header style="border-bottom: 1px solid #ccc;">
        <Header :collapseBtnClass="collapseBtnClass" :collapse="collapse" :user="user"/>

      </el-header>


      <el-main>
<!-- 当前页面的子路由会在 router-view里面展示 -->
        <router-view />
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
// @ is an alias to /src

import Aside from "@/components/Aside.vue";
import Header from "@/components/Header.vue";
import User from "@/components/User.vue";
import {del} from "vue";
import user from "@/components/User.vue";

export default {
  name: 'HomeView',
  computed: {
    user() {
      return user
    }
  },

  data() {

    return {

      logoTextShow: true,
      isCollapse: false,
      collapseBtnClass: 'el-icon-s-fold',
      sideWidth: 200,
    }
  },
  components: {
    Aside,
    Header,
    User,
  },

  methods: {

    collapse() {
      this.isCollapse = !this.isCollapse;
      if (this.isCollapse) {
        this.sideWidth = 64
        this.collapseBtnClass = 'el-icon-s-unfold'
        this.logoTextShow = false
      } else {
        this.sideWidth = 200
        this.collapseBtnClass = 'el-icon-s-fold'
        this.logoTextShow = true
      }
    },





  }

}
</script>

<style>

</style>